﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;
using DVO;

public partial class ListDocument : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.User.Identity.Name=="")
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            if (IsPostBack == false)
            {
                LoadData();

            }
        }
    }

    private void LoadData()
    {
        //string author = "";
        //if (!String.IsNullOrEmpty(Page.User.Identity.Name))
        //{
        //    author = Page.User.Identity.Name;
        //}
        //BLL_Working ObjBLL = new BLL_Working();
        //List<ins_Working_SearchResult> ObjList = new List<ins_Working_SearchResult>();
        //ObjList = ObjBLL.Document_Search(author).ToList();
        //grid.DataSource = ObjList;
        //grid.DataBind();

    }
    public string GetStatus(string Status)
    {
        if (Status == "0")
            return "Chờ kiểm duyệt";
        else if (Status == "1")
            return "Đã duyệt";
        else if (Status == "2")
            return "Chờ review";
        else if (Status == "3")
            return "Chỉnh sửa";
        return "";
    }
    protected void grid_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        grid.PageIndex = e.NewPageIndex;
        LoadData();
    }
}